package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;

/**
 * ClassName: LeaseException
 * Description:
 *   自定义的异常类
 * @Author 刘艳丽
 * @Create 2024/9/22 21:45
 * @Version 1.0
 */
public class LeaseException extends RuntimeException{
    private Integer code;

    public LeaseException(Integer code,String message){
        super(message);
        this.code = code;
    }
    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
